<template>
	<view>
		<!-- <u-navbar :is-back='false' :border-bottom='false' title='资讯列表' title-color='#ffffff' :is-fixed='true' :background='background'>
			<view class="slot-wrap">
				<view @click="back" style="border-radius: 50%;width: 50rpx;height: 50rpx;background-color:rgba(0,0,0,.2);position: relative;">
					<text class="iconfont icon-xiangzuo" style="font-size: 40rpx;color: #FFFFFF;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);"></text>
				</view>

			</view>
		</u-navbar> -->
		<view
			style="width: 750rpx;height: 300rpx;background: linear-gradient(180deg, #1fb0ac 0%, #FFFFFF 100%);position: relative;">
			<!-- <view
				style="width: 92%;color: #000000;overflow: hidden;line-height: 70rpx;font-size: 36rpx;margin: 0 auto;padding-top: 30rpx;">
				{{xiang.title || ''}}
			</view> -->
			<view v-html="xiang.title" style="width: 92%;margin: 0 auto;">

			</view>
			<view class="flex items-center" style="overflow: hidden;width: 92%;margin: 14rpx auto;line-height: 28rpx;">
				<text
					style="display: inline-block;height: 38rpx;background: #fff;border-radius: 10px;line-height: 38rpx;padding:10rpx 20rpx;float: left;font-size:24rpx ;color: #1FB0AD;">
					{{xiang.category.name || ''}}
				</text>
				<text style="line-height: 28rpx;color: #fff;font-size: 24rpx;margin: 0 30rpx;">
					懂鲜
				</text>
				<text style="line-height: 28rpx;color: #fff;font-size: 24rpx;">
					{{xiang.create_time}}
				</text>
			</view>
			<view style="width: 92%;margin: 0 auto;" class="title11">
				<view style="overflow: hidden;width: 100%;">
					<!-- <RichText :nodes="guest" /> -->
					<view v-html="guest" class="fs28"></view>
					<!-- <rich-text :nodes="guest"></rich-text> -->
					<!-- <u-parse :content="guest"></u-parse> -->
				</view>

				<!-- <view style="text-align: center;margin-top: 20rpx;" @click="chakan" v-if="kan">
					<image src="https://qiniuoss.yjqwl.cn/uploads/20220325/Fm66C568bN0i3hQBwgoPDi01YbYZ.png" style="width: 276rpx;height: 98rpx;" mode=""></image>
				</view>

				<view v-if="xiang.file_type==1 && !kan && xiang.main_file!=''" style="margin: 20rpx auto;">
					<free-audio startPic='https://qiniuoss.yjqwl.cn/uploads/20220321/FsiUTJhllF60xhs0n-YRCV9W1KPN.png' endPic='https://qiniuoss.yjqwl.cn/uploads/20220321/Fr8Nh8tg-rYjEToVlmMzJGO-SeUP.png' :audioId='audio1' :url='xiang.main_file'></free-audio>
				</view>
				<view v-if="xiang.file_type==2 && !kan && xiang.main_file!=''" style="margin: 20rpx auto;">
					 <video id="myVideo" style="width: 100%;" :src="xiang.main_file" controls></video>
				</view>
				<view v-if="xiang.file_type==3 && !kan && xiang.main_file!=''" @click="open(xiang.main_file)" style="width: 100%;line-height: 100rpx;height: 100rpx;background-color: #E0E0E0;font-size: 28rpx;text-align: center;margin-top: 30rpx;">
					点击打开文件
				</view> -->
			</view>


			<!-- <view style="overflow: hidden;width: 92%;margin: 20rpx auto;">

				<view style="float: right;line-height: 52rpx;">
					<image @click="dian" v-if="xiang.is_like==0"
						src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/dianzan.png"
						style="width: 52rpx;height: 52rpx;margin:0rpx 0rpx 0;float: left;" mode=""></image>
					<image @click="dian" v-if="xiang.is_like==1"
						src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/1a023247a937163224a49a8e7611789a.png"
						style="width: 36rpx;height: 36rpx;margin:8rpx 6rpx;float: left;" mode=""></image>
					<text style="color: #000000;font-size: 28rpx;float: left;">{{xiang.like_num || 0}}</text>
				</view>
				<view style="float: right;line-height: 52rpx;">
					<image src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/liulan.png"
						style="width: 52rpx;height: 52rpx;margin:0rpx 0rpx 0;float: left;" mode=""></image>
					<text style="color: #000000;font-size: 28rpx;float: left;">{{xiang.pv || 0}}</text>
				</view>



			</view>-->
			<view style="margin: 30rpx auto;overflow: hidden;width: 92%;" class="title22">
				<image v-for="(item,index) in  xiang.like_user" :key='index' :src="item" class="tou" mode=""></image>
				<view class="flex items-center" @click="dian" style="float: right;line-height: 52rpx;margin-top: 14rpx;">
					<u-icon v-if="xiang.is_like==2" name="thumb-up" color="#ABAFB3" size="20"></u-icon>
					<u-icon v-else-if="xiang.is_like==1" name="thumb-up" color="#2979ff" size="20"></u-icon>
					<text style="color: #000000;font-size: 28rpx;float: left;">{{xiang.like_num || 0}}人点赞</text>
				</view>
			</view>
			<view style="width: 100%;background-color: #f5f5f5;height: 20rpx;">

			</view>


			<view class="title33"
				style="width: 92%;color: rgba(255,255,255,.8);overflow: hidden;line-height: 50rpx;font-size: 30rpx;margin: 0 auto;padding-top: 30rpx;">
				<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false"
					:scroll-into-view="scrollInto">
					<view v-for="(tab,index) in ti_list" :key="tab.name" class="uni-tab-item" :id="tab.name"
						:data-current="index" @click="ontabtap(index,tab.id)">
						<text class="uni-tab-item-title"
							:class="tabIndex==index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
					</view>
				</scroll-view>
			</view>

			<view class="title44" style="padding-bottom: 120rpx;position: relative;">
				<view style="width: 92%;margin: 20rpx auto;" v-for="(item,index) in list" :key='index'>
					<view style="overflow: hidden;">
						<view style="width: 74rpx;height: 74rpx;float: left;margin-right: 20rpx;position: relative;">
							<image :src="item.client.avatar"
								style="width: 74rpx;height: 74rpx;display: block;border-radius: 12upx;overflow: hidden;"
								mode=""></image>
							<!-- <image v-if="item.is_vip==1" src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/ren.png"
								style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 1;"
								mode=""></image> -->
						</view>
						<view style="width: 85%;float: left;">
							<view style="line-height: 74rpx;width: 100%;height: 74rpx;box-sizing: border-box;padding-right: 200rpx;position: relative;">
								<text  style="color: #808080;font-size: 30rpx;float: left;">
									{{item.client.remark_name || item.client.name}}
								</text><!-- v-if="item.is_vip==0" -->
								<!-- <text v-if="item.is_vip==1" style="color: #F29100;font-size: 30rpx;float: left;">
									{{item.client.nickname || ''}}
								</text> -->
								<!-- <image v-if="item.is_vip==1" @click="mpxq(item.user_id,item.is_vip)"
									src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/shengfen.png"
									style="width: 54rpx;height: 40rpx;float: left;margin-top: 18rpx;" mode=""></image> -->
								<text v-if="item.is_check==1" @click="del_one(item.id,index)" style="color: red;font-size: 24rpx;position: absolute;top: 50%;right: 70rpx;transform: translateY(-50%);">删除</text>
								<text @click="erji(item.id)" style="color: #1fb0ac;font-size: 24rpx;position: absolute;top: 50%;right: 0rpx;transform: translateY(-50%);">回复</text>
								<!-- <text @click="erji(item.id)" style="color: #1fb0ac;font-size: 24rpx;float: right;">
									回复
								</text> -->
							</view>
							<view style="margin-top: 30rpx;color: #333333;font-size: 28rpx;line-height: 40rpx;">
								{{item.comment_content || ''}}
							</view>
							<view style="margin-top: 20rpx;color:#999999;font-size: 26rpx;line-height: 40rpx;">
								{{item.create_time | getLocalTime}}
							</view>
							<view v-if="item.child.length>0"
								style="margin: 10rpx auto 30rpx;box-sizing: border-box;padding: 30rpx;border-radius: 10rpx;background-color:#F7F7F7 ;font-size: 26rpx;line-height: 50rpx;width: 100%;">
								<view v-for="(a,b) in item.child" :key='b' style="box-sizing: border-box;padding-right: 100rpx;position: relative;width: 100%;">
									<text style="color: #336699;">{{a.client.remark_name || a.client.name}}：</text>
									<text style="color: #333333;">{{a.comment_content}}</text>
									<text v-if="a.is_check==1" @click="del_two(a.id,index,b)" style="color: red;font-size: 24rpx;position: absolute;top: 50%;right: 0;transform: translateY(-50%);">删除</text>
								</view>

							</view>
						</view>
					</view>
				</view>

				<view v-if="kk" style="text-align:center;">
					<image src="https://qiniuoss.yjqwl.cn/uploads/20211111/FljQNmzWmi-mO8CGX0Zy28Cc-QdS.png"
						style="width: 490rpx" mode="widthFix"></image>
				</view>
				<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
					v-if="list.length==0"></u-divider>
				<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
					v-if="list.length>0 && enmpy"></u-divider>
			</view>
		</view>

		<view style="width:100%;height: 130rpx;line-height: 100rpx;background-color: #FFFFFF;overflow: hidden;box-sizing: border-box;padding: 20rpx 20rpx 50rpx 20rpx;position: fixed;bottom: 0;left: 0;z-index: 2;" class="flex items-center">
			<view class="flex-1" style="position: relative;">
				<input type="text"   v-model="content" placeholder="我要评论..."
					style="width: 100%;height: 60rpx;line-height: 60rpx;background-color: #F6F6F6;box-sizing: border-box;padding: 0 100rpx 0 20rpx;font-size: 26rpx;color: #999999;border-radius: 30rpx;" />
				<text @click="ping(0,content)"
					style="font-size: 24rpx;color: #1fb0ac;position: absolute;top: 50%;right: 20rpx;transform: translateY(-50%);">评论</text>
			</view>
			<view>
				<image @click="zhu" src="@/static/forign/page-index.png"
					style="width:60rpx ;height: 60rpx;float: left;margin: 2rpx 0 2rpx 20rpx;" mode=""></image>
				<button type="default"
					style="width:50rpx ;height: 50rpx;float: left;margin: 5rpx 20rpx;display: inline-block;position: relative;"
					open-type='share'>
					<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/4fcdeae6e9ccf0f99aa625071b4bbfc8.png"
						style="width:50rpx;height: 50rpx;position: absolute;top: 0;left: 0;" mode=""></image>
				</button>

				<view style="float: left;position: relative;">
					<image @click="shou" v-if="xiang.is_collect==2"
						src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/xq/xingxing.png"
						style="width:50rpx ;height: 50rpx;float: left;margin: 5rpx 0 0 0;" mode=""></image>
					<image @click="shou" v-if="xiang.is_collect==1"
						src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/xq/xing.png"
						style="width:50rpx ;height: 50rpx;float: left;margin: 5rpx 0 0 0;" mode=""></image>
					<!-- <text
						style="background-color: #FF3333;height: 24rpx;line-height: 24rpx;text-align: center;padding:0 10rpx ;font-size: 16rpx;border-radius: 12rpx;position: absolute;top: 0;right: 0;color: #FFFFFF;">
						{{xiang.collect_num>10000?( (xiang.collect_num/10000).toFixed(1)+'万' ):xiang.collect_num || 0}}
					</text> -->
				</view>

			</view>
		</view>

		<uni-popup id="popup" ref="popup1" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao1"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login1" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>

				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup5" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 600rpx;margin: 0 auto;">
				<textarea   v-model="nei" placeholder="请输入您的评论"
					style="padding:20rpx;font-size: 24rpx;line-height: 40rpx;height: 200rpx;" />
				<view class="footer">
					<button @click="quxiao5"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @click="huifu" lang="zh_CN" style="flex: 1;background-color: #1fb0ac;color: #FFFFFF;"
						open-type="getUserInfo">回复</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>

		<uni-popup id="popup" ref="popup2" :type="type" :animation="true">
			<view class="" style="border-radius: 20upx;width: 640rpx;height: 600rpx;position: relative;">
				<image src="https://qiniuoss.yjqwl.cn/uploads/20211203/Fng6fsTdaGgv1PZ2eurMf6KF3AXj.png" style="width: 640rpx;height: 480rpx;position: absolute;top: 0;left: 0;"  mode=""></image>

				<view v-if="wz_status==2 && vip_status!=1" style="width: 90%;line-height: 40rpx;color: #333333;font-size: 28rpx;position: absolute;top: 100rpx;left: 50%;transform: translateX(-50%);text-align: center;">
					{{price}}元(或{{score}}积分)查看本文详情</br>
					开通会员可查看所有会员专区内容</br>
					开通会员价:<text v-for="(item,index) in listqian" :key='index'><text style="color: red;font-size: 30rpx;">{{item.money}}元</text>/{{item.year}}年 <text v-if="listqian.length!=index+1">、</text></text>
				</view>
				<view v-if="wz_status==3 && vip_status!=1" style="width: 90%;line-height: 36rpx;color: #333333;font-size: 28rpx;position: absolute;top: 110rpx;left: 50%;transform: translateX(-50%);text-align: center;">
					支付后可查看本文详情,加入会员可享会员价</br>
					非会员价：{{price}}元(或{{score}}积分)</br>
					会员价：{{vip_price}}元(或{{vip_score}}积分)</br>
					<!-- 开通会员价格:<text v-for="(item,index) in listqian" :key='index'><text style="color: red;font-size: 30rpx;">{{item.money}}元</text>/{{item.year}}年 <text v-if="listqian.length!=index+1">、</text></text> -->
				</view>
				<view v-if="wz_status==3 && vip_status==1" style="width: 90%;line-height: 50rpx;color: #333333;font-size: 30rpx;position: absolute;top: 130rpx;left: 50%;transform: translateX(-50%);text-align: center;">
					会员专享<br/>
					{{vip_price}}元(或{{vip_score}}积分)</br>查看本文详情
				</view>
				<view v-if="wz_status==3 && vip_status==1" style="position: absolute;top: 230rpx;left: 50%;transform: translateX(-50%);width: 90%;">
					<!-- <view @click="ff(index)" style="display: flex;line-height: 60rpx;text-align: center;text-align: center;" v-for="(item,index) in zf2_list" :key='index'>
						<view  style="flex: 2;">
							<image  :src="index+1==ff_status?xz1:wxz1"  style="width: 30rpx;height: 30rpx;" mode=""></image>
						</view>
						<view style="flex:3;text-align: left;">
							{{item}}
						</view>
					</view> -->
				</view>
				<view v-else style="position: absolute;top: 240rpx;left: 50%;transform: translateX(-50%);width: 90%;">
					<view @click="ff(index)" style="display: flex;line-height: 50rpx;text-align: center;text-align: center;" v-for="(item,index) in zf1_list" :key='index'>
						<view  style="flex: 2;">
							<image  :src="index+1==ff_status?xz1:wxz1"  style="width: 30rpx;height: 30rpx;" mode=""></image>
						</view>
						<view style="flex:3;text-align: left;">
							{{item}}
						</view>
					</view>
				</view>


				<view class="" style="display: flex;margin-top: 30rpx;position: absolute;top: 330rpx;left: 50%;transform: translateX(-50%);text-align: center;width: 90%;">
					<view @click="quxiao2" style="margin-right:20rpx;flex:1;height: 76rpx;line-height: 76rpx;border-radius: 40rpx;color: #E6A06C;font-size: 30rpx;text-align: center;border: 1px solid #E6A06C;">
						取消
					</view>
					<view @click="guanbi2" style="flex:1;height: 80rpx;line-height: 80rpx;background-color: #ECBD5C;border-radius: 40rpx;color: #FFFFFF;font-size: 30rpx;text-align: center;">
						确定
					</view>
				</view>
			</view>
		</uni-popup>


		<uni-popup id="popup" ref="popup3" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx;border-radius: 20upx;width: 600rpx;">
				<view style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					选择支付方式
				</view>
					<view @click="zffs(index)" style="display: flex;line-height: 60rpx;text-align: center;" v-for="(item,index) in zf_list" :key='index'>
						<view  style="flex: 2;">
							<image  :src="index+1==zf_status?xz:wxz"  style="width: 30rpx;height: 30rpx;" mode=""></image>
						</view>
						<view style="flex:3;text-align: left;">
							{{item}}
						</view>
					</view>

				<view class="" style="display: flex;margin-top: 30rpx;">
					<view @click="quxiao3" style="margin-right:20rpx;flex:1;height: 80rpx;line-height: 80rpx;background-color: #C0C0C0;border-radius: 40rpx;color: #FFFFFF;font-size: 30rpx;text-align: center;">
						取消
					</view>
					<view @click="guanbi3" style="flex:1;height: 80rpx;line-height: 80rpx;background-color: #1fb0ac;border-radius: 40rpx;color: #FFFFFF;font-size: 30rpx;text-align: center;">
						确定
					</view>
				</view>
			</view>
		</uni-popup>

		<u-modal v-model="show" @confirm="confirm12" @cancel="cancel12" :content='neirong' ref="uModal"
			:show-cancel-button='true'></u-modal>
		<noLoginToast ref="noLoginToast"/>
		<model ref="model"/>
	</view>
</template>
<script>
	import freeAudio from '@/components/chengpeng-audio/free-audio.vue'
	export default {
		components: {freeAudio},
		data() {
			return {
				background: {
					background: 'linear-gradient(180deg, #0078FF 0%, #1fb0ac 100%)'
				},
				scrollInto: '',
				ti_list: [{
					id: '0',
					name: '评论'
				}],
				id: '',
				tabIndex: 0,
				xiang: {},
				guest: '',
				type: 'center',
				content: '',
				nei: '',


				page: 1,
				kk: false,
				enmpy: false,
				list: [],
				status: '',
				loading: false, //开启loading不显示默认值
				show: false,
				neirong: '只有会员才有权限查看,请先成为会员',


				xz:'https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/54.png',
				wxz:'https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/53.png',


				xz1:'https://qiniuoss.yjqwl.cn/uploads/20211202/FkN30x9LjjabUbw1KCzyNsS7NGgl.png',
				wxz1:'https://qiniuoss.yjqwl.cn/uploads/20211202/FkioTkXoDKWrGBKGu_RJPpzkFcPm.png',
				zf1_list:['开通会员','单次付费'],
				zf2_list:['单次付费'],
				ff_status:1,
				zf_list:['微信支付','积分支付'],
				zf_status:1,
				xq_id:'',
				listqian:[],
				price:'',
				score:'',
				kan:false,
				path: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3',
				vip_status:'',
				wz_status:'',
				vip_price:'',
				vip_score:'',
				degree:'',
				richText:'',
				pingguo_xian:false,
			}
		},
		onLoad(option) {
			this.id = option.id
			this.pingguo()
			// this.xq()
			// this.hqpl()
			// this.qian()
		},
		// onPullDownRefresh() {
		// 	this.xq()
		// 	this.yang()
		// 	setTimeout(function() {
		// 		uni.stopPullDownRefresh();
		// 	}, 1500);
		// },
		onPullDownRefresh() {
			this.xq()
			this.page = 1
			this.kk = false
			this.enmpy = false
			this.list = []
			this.hqpl()
			console.log(1111111111)
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 2000);
		},
		onShow() {
			this.user_infoxx()
			this.page = 1
			this.kk = false
			this.enmpy = false
			this.list = []
			this.xq()
		},
		onReachBottom() {
			if (this.enmpy) {
				return
			} else {
				console.log(222222)
				this.hqpl()
			}
		},
		onShareTimeline(e) {
			// let title = '恭喜dog.东西获得成功'
			let that = this
			return {
				title: this.xiang.transmit_title,
				path: '/fenbao/pages/shou/zxxq?id=' + this.id,
				imageUrl: this.xiang.image,
				success: function() {
					that.post('api/share/share', '', true).then(res => {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					})
				}
			}
		},
		onShareAppMessage(e) {
			let that = this
			// let title = '恭喜dog.东西获得成功'
			return {
				title: this.xiang.transmit_title,
				path: '/fenbao/pages/shou/zxxq?id=' + this.id,
				imageUrl: this.xiang.image,
				success: function() {
					that.post('api/share/share', '', true).then(res => {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					})
				}
			}
		},
		methods: {
			async del_one(id,index){
				let that=this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.showModal({
					title: '提示',
					content: '确定删除此条评论？',
					success: function (res1) {
						if (res1.confirm) {
							that.post('api/information/delete_comment',{comment_id:id},true).then(res=>{
								if(res.code==1){
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
									that.list.splice(index,1)
									that.$forceUpdate()
								}else{
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
								}
							})
						} else if (res1.cancel) {

						}
					}
				});
			},
			async del_two(id,index,b){
				let that=this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.showModal({
					title: '提示',
					content: '确定删除此条评论？',
					success: function (res1) {
						if (res1.confirm) {
							that.post('api/information/delete_comment',{comment_id:id},true).then(res=>{
								if(res.code==1){
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
									that.list[index].child.splice(b,1)
									that.$forceUpdate()
								}else{
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
								}
							})
						} else if (res1.cancel) {

						}
					}
				});
			},

			// 获取用户信息
			user_infoxx() {
				this.post('api/client/info', '', true).then(res => {
					console.log(res)
					if(res.code==1){
						this.degree=res.data.degree
					}
				})
			},
			open (pdfUrl) {
			      // 1.pdfUrl  可以直接在浏览器打开  2.一定要在小程序后台配置该pdf的域名 让其可以下载
			      uni.showLoading({
			        title: '正在打开...'
			      })
			      uni.downloadFile({
			        url: pdfUrl,
			        success: function (res) {
			          console.log('下载的res', res)
			          var filePath = res.tempFilePath
					 //  uni.saveFile({
					 //        tempFilePath: encodeURI(filePath),
					 //        success: function (re) {
					 //         console.log(re,123456789)
					 //        }
					 //    });
						// uni.getSavedFileList({
						//   success: function (r) {
						//     console.log(r,147258);
						//   }
						// });
			          uni.openDocument({
			            filePath: encodeURI(filePath),
			            // fileType: 'pdf',
			            success: function (res) {
			              uni.hideLoading()
			              // uni.showToast({
			              //   title: '打开文档成功',
			              //   duration: 1500,
			              //   icon: 'none'
			              // })
			              console.log('打开文档成功')
			            },
			            fail: function (err) {
			              uni.hideLoading()
			              uni.showToast({
			                title: '打开失败',
			                duration: 1500,
			                icon: 'none'
			              })
			              console.log('打开失败')
			            }
			          })
			        },
			        fail: function (err) {
			          console.log('下载失败原因', err)
			          uni.hideLoading()
			          setTimeout(() => {
			            uni.showToast({
			              title: '下载失败',
			              duration: 1500,
			              icon: 'none'
			            })
			          }, 1500)
			        }
			      })
			    },
			ff(index){
				this.ff_status=index+1
			},
			quxiao2(){
				this.$refs.popup2.close()
			},
			guanbi2(){
				this.$refs.popup2.close()
				if(this.wz_status==3 && this.vip_status==1){
					this.ff_status=2
				}
				if(this.ff_status==1){
					uni.navigateTo({
						url:'/subpages/pages/vip'
					})
				}else{
					this.$refs.popup3.open()
				}
			},
			zffs(index){
				this.zf_status=index+1
			},
			quxiao3(){
				this.$refs.popup3.close()
			},
			guanbi3(){
				let that=this
				this.$refs.popup3.close()
				this.post('api/knowledge/read_news',{news_id:this.id,trade_type:this.zf_status},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.zf_status==1){
							uni.getSystemInfo({
							    success: function (res) {
									let str = res.model
									console.log(str.indexOf("iPhone") != -1); // true
									that.post('api/index/wechat_check','',true).then(re=>{
										if(str.indexOf("iPhone") != -1){
											if(re.data==1){
												that.fukuan()
											}else{
												uni.showModal({
												    title: '温馨提示',
												    content: '由于相关规范，ios功能暂不可用！',
												    success: function (res) {
												        if (res.confirm) {

												        } else if (res.cancel) {

												        }
												    }
												});

											}
										}else{
											that.fukuan()
										}
									})

							    }
							});
						}else{
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
							 that.xq()
						}
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			pingguo(){
				let that=this
				uni.getSystemInfo({
					    success: function (res) {
							let str = res.model
							console.log(str.indexOf("iPhone") != -1); // true
							that.post('api/index/wechat_check','',true).then(re=>{
								if(re.data==1){
									that.pingguo_xian=true
								}else{
									that.pingguo_xian=false
								}
								// if(str.indexOf("iPhone") != -1){
								// 	if(re.data==1){
								// 		that.pingguo_xian=true
								// 	}else{
								// 		that.pingguo_xian=false
								// 	}
								// }else{
								// 	that.pingguo_xian=true
								// }
							})

					    }
					});
			},
			fukuan(){
				let that=this
				uni.requestPayment({
				    provider: 'wxpay',
				    timeStamp: res.data.pay.timeStamp,
				    nonceStr: res.data.pay.nonceStr,
				    package: res.data.pay.package,
				    signType: res.data.pay.signType,
				    paySign: res.data.pay.paySign,
				    success: function (res) {
				      uni.showToast({
				      	title: '支付成功',
				      	icon: "none",
				      	duration: 1000
				      })
					  that.xq()
				    },
				    fail: function (err) {
				        console.log('fail:' + JSON.stringify(err));
				    }
				});
			},
			// 配置
			qian(){
				this.post('api/vip/lists','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.listqian=res.data
					}
				})
			},
			async mpxq(id,vip){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					console.log('%c [ isHasMobile ]-452', 'font-size:13px; background:pink; color:#bf2c9f;', isHasMobile)
					if (isHasMobile) {
						if(vip==1){
							uni.navigateTo({
								url:'../my/mingpian?id='+id
							})
						}
					}
				}
			},

			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			async xq() {
				let that = this
				that.post('api/information/info', {
					id: that.id
				}, true).then(res => {
					if (res.code == 1) {
						that.guest = res.data.main_content.replace(/<img/gi, '<img class="rich-img" ')
										.replace(/<p/g, '<div')
										.replace(/\/p>/g, '\div>');
						that.kk = false
						that.enmpy = false
						that.list = []
						that.page=1
						that.hqpl()
						that.xiang = res.data
						that.wz_status=res.data.is_vip
					}
				})
			},
			async chakan(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					console.log('%c [ isHasMobile ]-452', 'font-size:13px; background:pink; color:#bf2c9f;', isHasMobile)
					if (isHasMobile) {
						if(this.pingguo_xian){
							this.$refs.popup2.open()
						}else{

						}
					}
				}

			},
			confirm12() {
				this.show = false
				uni.redirectTo({
					url: 'vip'
				})
			},
			cancel12() {
				this.show = false
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			quxiao1() {
				this.$refs.popup1.close()
			},
			quxiao5() {
				this.$refs.popup5.close()
			},
			// 点赞
			async dian() {
				let that = this
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					this.post('api/information/like', {
						news_id: this.id
					}, true).then(res => {
						console.log(res)
						if (res.code == 1) {
							uni.showToast({
								icon: 'none',
								title: res.msg,
								duration: 1500
							});
							if (res.data) {
								this.xiang.is_like = 1
								this.xiang.like_num += 1
								this.xiang.like_user.push(uni.getStorageSync('userinfo').avatar)
							} else {
								this.xiang.is_like = 2
								this.xiang.like_num -= 1
								this.xiang.like_user.pop()
							}
						}
					})
				}
			},
			// 收藏
			async shou() {
				let that=this
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				this.post('api/information/collect', {
					news_id: this.id
				}, true).then(res => {
					console.log(res)
					if (res.code == 1) {
						uni.showToast({
							icon: 'none',
							title: res.msg,
							duration: 1500
						});
						if (res.data) {
							this.xiang.is_collect = 1
							this.xiang.collect_num += 1
						} else {
							this.xiang.is_collect = 2
							this.xiang.collect_num -= 1
						}
					}
				})
			},
			// 评论
			async ping(pid, rong) {
				let that = this
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				if(this.degree<100){
					this.$refs.model.open()
				}else {
					if (rong == '') {
						uni.showToast({
							icon: 'none',
							title: '请输入评论内容',
							duration: 1500
						});
						return
					}
					this.post('api/information/publish_comment', {
						news_id: this.id,
						pid: pid,
						comment_content: rong
					}, true).then(res => {
						console.log(res)
						if (res.code == 1) {
							uni.showToast({
								icon: 'none',
								title: res.msg,
								duration: 1000
							});
							setTimeout(function(){
								that.content = ''
								that.page = 1
								that.kk = false
								that.enmpy = false
								that.hqpl(1)
							},1500)

						} else {
							uni.showToast({
								icon: 'none',
								title: res.msg,
								duration: 1500
							});
						}
					})
				}

			},
			// 获取评论
			hqpl(click) {
				this.post('api/information/comment', {
					news_id: this.id,page:this.page,limit:10
				}, true).then(res => {
					console.log(res, 123456)
					console.log(88888888)
					if (res.code == 1) {
						if (this.page == 1) {
							if (res.data.data == null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						} else {
							if (res.data.data == null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						if (click == 1) {
							this.list = []
						}
						this.list.push(...res.data.data)
					} else {
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
					console.log(this.list, 11147885555)
				})
			},
			async erji(id) {
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				if(this.degree<100){
					this.$refs.model.open()
				}else {
					this.$refs.popup5.open()
					this.status = id
				}

			},
			// quxiao2(){
			// 	this.$refs.popup2.close()
			// },
			huifu() {
				this.$refs.popup5.close()
				this.ping(this.status, this.nei)
			},

			zhu() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			fen() {

			}
		},
		filters: {
			getLocalTime(fmt) {
				console.log(fmt);
				function PrefixZero(num, n) {
					return (Array(n).join(0) + num).slice(-n);
				}
				var time = '';
				var date = new Date(fmt * 1000);
				var Y = date.getFullYear();
				var M = date.getMonth() + 1;
				var D = date.getDate();
				var h = PrefixZero(date.getHours(), 2);
				var m = PrefixZero(date.getMinutes(), 2);

				var s = PrefixZero(date.getSeconds(), 2);
				time = Y + '-' + M + '-' + D +'    '+h+':'+m+':'+s;
				return time;
			}
		},
	}
</script>

<style lang="scss">
	.tou {
		width: 54rpx;
		height: 54rpx;
		float: left;
		border-radius: 50%;
		margin-left: -20rpx;
		margin-top: 10rpx;
	}

	.tou:first-child {
		margin-left: 0;

	}
	.tou:nth-child(19n+1) {
		margin-left: 0;

	}

	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;

		}
	}

	button:after {
		border: 0;
		background: none;
	}
	button[type='default'] {
	    background: none!important;
	    color: #000;
	}

	.rich-img {
		max-width: 90%!important;
		height: auto;
		// background-color: #FFFFFF;
	}

	.slot-wrap {
		display: flex;
		align-items: center;
		/* 如果您想让slot内容占满整个导航栏的宽度 */
		/* flex: 1; */
		/* 如果您想让slot内容与导航栏左右有空隙 */
		padding: 0 30rpx;
	}

	page {
		background-color: #FFFFFF !important;
		height: 100%;
		font-family: Demibold;
	}

	.scroll-h {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		flex-direction: row;
		/* #ifndef APP-PLUS */
		white-space: nowrap;
		/* #endif */
		/* flex-wrap: nowrap; */
		/* border-color: #cccccc;
			border-bottom-style: solid;
			border-bottom-width: 1px; */
	}

	.uni-tab-item {
		/* #ifndef APP-PLUS */
		display: inline-block;
		/* #endif */
		flex-wrap: nowrap;
		/* float: left; */
		position: relative;
		display: inline-block;
	}

	.uni-tab-item:after {}

	.uni-tab-item:first-child:after {
		background: none;
	}

	.uni-tab-item-title {
		height: 40rpx;
		line-height: 40rpx;
		flex-wrap: nowrap;
		font-size: 32rpx;
		color: #000;
		/* #ifndef APP-PLUS */
		white-space: nowrap;
		/* #endif */
		&::after {
			display: block;
			content: "";
			width: 100%;
			height: 6rpx;
			background-color: #19BE6B;
			border-radius: 6rpx;
			position: absolute;
			bottom: 0;
			left: 0;
			z-index: 11;
		}
	}

	.uni-tab-item-title-active {
		font-weight: 600;
		font-size: 30rpx;
		color: #000000;
	}
</style>
